import http from "./httpInstance";
function getupd(params) {
  return http({
    method: "post",
    url: "/vmp-server/api/sysmanage/inspect/upd",
    data: params,
  });
}

function getassign(params) {
  return http({
    method: "post",
    url: "/vmp-server/api/sysmanage/inspect/assign",
    data: params,
  });
}

function getlist(params) {
  return http({
    method: "post",
    // url: '/vmp-server/api/sysmanage/inspect/getlist',
    url: "/integrated-workbench/v1/streetalertplatform/event/eventflow/inspect/inspect/getlist",
    data: params,
  });
}

function getlistN(params) {
  return http({
    method: "post",
    url: "/vmp-server/api/sysmanage/users/getlist",
    // url: '/integrated-workbench/v1/streetalertplatform/event/eventflow/inspect/getlist',
    data: params,
  });
}

function getOrgsOnTreeView(params) {
  return http({
    method: "post",
    // url: '/vmp-server/v1/org/getOrgsOnTreeView',
    url: "/integrated-workbench/v1/streetalertplatform/event/eventflow/inspect/getOrgsOnTreeView",
    data: params,
  });
}

function gettasklist(params) {
  return http({
    method: "post",
    // url: '/vmp-server/v1/inspect/staff/gettasklist',
    url: "/integrated-workbench/v1/streetalertplatform/event/eventflow/inspect/gettasklist",
    data: params,
  });
}

function gettaskroutes(params) {
  return http({
    method: "post",
    url: "/vmp-server/v1/inspect/staff/gettaskroutes",
    data: params,
  });
}

function starttask(params) {
  return http({
    method: "post",
    url: "/vmp-server/v1/inspect/staff/starttask",
    data: params,
  });
}

function updtaskroutestate(params) {
  return http({
    method: "post",
    url: "/vmp-server/v1/inspect/staff/updtaskroutestate",
    data: params,
  });
}

function bydeviceid(params) {
  return http({
    method: "post",
    url: "/vmp-server/v1/inspect/staff/geteventlist/bydeviceid",
    data: params,
  });
}

function getparamdict(params) {
  return http({
    method: "post",
    url: "/vmp-server/v1/common/getparamdict",
    data: params,
  });
}

function reportevent(params) {
  return http({
    method: "post",
    url: "/vmp-server/v1/inspect/staff/reportevent",
    data: params,
  });
}

function uploadpic(params) {
  return http({
    method: "post",
    url: "/vmp-server/v1/inspect/staff/uploadpic",
    data: params,
    headers: { "Content-Type": "multipart/form-data" },
  });
}

function getcameraurl(params) {
  return http({
    method: "post",
    url: "/vmp-server/v1/common/getcameraurl",
    data: params,
  });
}

function handlecameracontrol(params) {
  return http({
    method: "post",
    url: "/integrated-workbench/v1/enforcement/handlecontrol",
    data: params,
  });
}

function bytaskid(params) {
  return http({
    method: "post",
    url: "/vmp-server/v1/inspect/staff/gethisrecord/bytaskid",
    data: params,
  });
}

// 根据任务id获取历史记录的摄像头回放地址
// 定义一个函数playbackcameraurl，用于获取回放摄像头url
function playbackcameraurl(params) {
  return http({
    method: "post",
    url: "/integrated-workbench/v1/enforcement/playbackcameraurl",
    data: params,
  });
}
// 通过传过来的id，调取接口，获得流的id数组
function getwithdrawtransferinfo(params) {
  return http({
    method: "post",
    url: "/integrated-workbench/v1/mobileapp/withdrawtransferinfo",
    data: params,
  });
}
// 通过diviceid，调取接口，获得当前点位信息
function getcameradetail(params) {
  return http({
    method: "post",
    url: "/integrated-workbench/v1/camera/getcameradetail",
    data: params,
  });
}
function getmeeting(params) {
  console.log("getmeeting params:", params);
  return http({
    headers: {
      "Content-Type": "application/json",
      Authorization: params.token,
    },
    method: "post",
    url: "/integrated-workbench/v1/meeting/begin",
    data: params,
  });
}

export {
  bytaskid,
  handlecameracontrol,
  getcameraurl,
  uploadpic,
  reportevent,
  getparamdict,
  bydeviceid,
  updtaskroutestate,
  starttask,
  gettaskroutes,
  gettasklist,
  getOrgsOnTreeView,
  getlistN,
  getlist,
  getupd,
  getassign,
  getmeeting,
  playbackcameraurl,
  getwithdrawtransferinfo,
  getcameradetail,
};
